home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir33 / rfp106.zip / FORM4X.ZIP / FMMTH.HLP < prev    next >
Text File  |  1991-10-05  |  7KB  |  173 lines

  1. **************************** Math Operations Help ****************************
  2.  
  3. Defining math operations allows use of addition, subtraction, multiplication,
  4. division, and powers (including square roots) to solve equations posed by your
  5. forms.  When performed, numbers are taken from fields in your form, or from
  6. the equations you define, and then processed.  Results are loaded into fields
  7. of your form in various formats such as integer, floating point, and
  8. scientific notation.
  9.  
  10. There are 16 lines on this special form in which you may enter 1 or more
  11. mathematical equations.  Each equation must fit entirely on a line, it can not
  12. span two lines.  Equations on the same line must be separated by a space
  13. except when merging (explained later).  They are processed in order from left
  14. to right, then top to bottom.  Equations have the following form:
  15.  
  16.   Expression=Result          Example:  #15*#16/100=#17
  17.  
  18. "#15*#16/100" is the expression and "#17" is the result.  This expression
  19. consists of the three operands:  "#15" for field 15, "#16" for field 16, and
  20. "100".  There are two operators:  "*" for multiplication, and "/" for
  21. division.  In this example fields 15 and 16 are multiplied together, divided
  22. by 100, then placed into field 17.
  23.  
  24. Rules for expressions:
  25.  
  26.     o  Consist of 1 or more operands each separated by an operator:
  27.        +, -, *, /, and ^.
  28.     o  An expression must begin and end with an operand with one
  29.        exception:  it may begin with a -.
  30.     o  Expressions are evaluated left to right.  They are written in a
  31.        manner similar to the way you would use a simple calculator.
  32.  
  33. Rules for operands:
  34.  
  35.     o  May be contents of a field, a number, or 1 of 20 registers
  36.        (memories).
  37.     o  The contents of a field are represented by the number of that
  38.        field preceded by a #.  Example:  contents of field 15 are
  39.        "#15".  A field number may be followed by an "@" sign and a
  40.        positive integer to perform stepping that simplify long
  41.        repetitive expressions.  Example:  "#15@3".  See STEPPING at
  42.        end of this section.
  43.     o  A number can be an integer or decimal number up to 60 digits
  44.        long.  It must be positive.
  45.     o  The 20 registers are represented by the capitol letters A
  46.        through T.  They are initially zero when Form Master starts.
  47.  
  48. Operators:
  49.  
  50.     Addition              +
  51.     Subtraction           -
  52.     Multiplication        *
  53.     Division              /
  54.     Power                 ^
  55.  
  56. Rules for results:
  57.  
  58.     o  Can be loaded into a field, or into 1 of 20 registers.
  59.     o  A field used for output is specified by the number of that field
  60.        preceded by a # and followed by a colon and the output format.
  61.        Example:  #17:F8.2   "F8.2"is the format.  A default format of
  62.        F6.2 is assumed if the colon and format are left off.  The default
  63.        allows for numbers ranging from "-99.99" to "999.99".
  64.     o  The 20 registers are represented by the capitol letters A through T.
  65.  
  66. Rules for formats:
  67.  
  68.     o  Possible formats are:  "Iw", "Fw.d", and "Ew.d".
  69.     o  "Iw" is an integer format (no decimal point) "w" digits wide.
  70.        Example: 35.4 loaded into a field using an I3 format becomes " 35".
  71.     o  "Fw.d" is a floating point format (with decimal point) "w"
  72.        digits wide with "d" digits following the decimal point.
  73.        Example:  35.4 loaded into a field using an F5.2 format becomes
  74.        "35.40".
  75.     o  "Ew.d" is a floating point format (with decimal point) using
  76.        scientific notation which is "w" digits wide with "d" digits
  77.        following the decimal point.  Example  35.4 loaded with E10.3
  78.        becomes "  .354E+02".
  79.     o  Any number which requires more than "w" digits to load will
  80.        cause the field to fill with "*'s".
  81.     o  A format cannot specify more characters "w" than the field is
  82.        wide or an error will result during execution.
  83.  
  84. Examples:
  85.  
  86. Two equations placed on the same line:
  87.  
  88.       #1+#2/100=#3:F5.2 #1+#3*#7=#8:I8
  89.  
  90.   (1) Add fields 1 and 2, divide by 100, then place in field 3 as
  91.       number xx.xx, (5 digits wide with 2 decimal places)
  92.  
  93.   (2) Field 7 times sum of fields 1 and 3, place into field 8 as
  94.       xxxxxxxx, (8 digits wide)
  95.  
  96. Use of square root and temporary value:
  97.  
  98.     #1+#2=A #3+#4*A^.5=#5:E9.4
  99.  
  100.   Square root of ( ( sum of fields 1 and 2 ) times ( sum of fields 3
  101.   and 4 ) ), place result into field 5 as .xxxxE+xx.
  102.   Note the use of the temporary register "A" to hold the sum of fields
  103.   1 and 2.  This is necessary since parenthesis are not allows in the
  104.   equations.
  105.  
  106. Equation beginning with a "-" and using the default format:
  107.  
  108.     -#1=#2
  109.  
  110.   Field 2 is written as xxx.xx and is the negative of field 1.
  111.  
  112. Merging:
  113.  
  114. If the result of an equation is used as the first operand in the next
  115. equation, the two equations can be merged to save space.  Suppose you want
  116. field 3 to be sum of fields 1 and 2, then field 5 to be the product of fields
  117. 3 and 4.  The following two equations:
  118.  
  119.     #1+#2=#3:I4 #3*#4=#5
  120.  
  121. can be merged by removing the " #3" at the beginning of the second equation.
  122. The result is:
  123.  
  124.     #1+#2=#3:I4*#4=#5
  125.  
  126. The following equation shows a way to make field 3 be the square of the sum of
  127. fields 1 and 2:
  128.  
  129.     #1+#2=A*A=#3
  130.  
  131. Stepping:
  132.  
  133. Long repetitive expressions involving multiplication, addition, and
  134. subtraction can be simplified using a stepping option.  In expressions where
  135. the operation is the same over uniformly spaced fields (field number
  136. increments by some constant), only the first and last field numbers and a
  137. stepping count are specified:
  138.  
  139.     #1+#2+#3+#4+#5=#6       can be replaced by    #1+#5@1=#6
  140.  
  141.     #4*#8*#12*#16+#17=#18   can be replaced by    #4*#16@4+#17=#18
  142.  
  143.     #7-#9-#11-#13=#15       can be replaced by    #7-#13@2=#15
  144.  
  145. Only positive step counts are allowed.  The last field number minus the first
  146. field number in the stepping loop must be positive and a multiple of the step
  147. count.
  148.  
  149. Notes:
  150.  
  151. Use F6 to display all the fields in order with their number, row, column, and
  152. size.  (F6 has been redefined on this form to display the file FIELDS.LST.)
  153. If your form is edited in such a way that fields are added, removed, or their
  154. ordering is changed, you must make corresponding changes here to account for
  155. the changes in the field numbers.  Otherwise, the math feature may not work
  156. properly.
  157.  
  158. To right justify the result in the field, use the word processing features
  159. form to define that field as right justified.  The same is true for left and
  160. center justification.
  161.  
  162. Double precision arithmetic (IEEE standard) is used for all math operations.
  163. This has approximately 15 significant digits of accuracy.  All numbers are
  164. converted to double precision before use.  Results placed into fields are
  165. rounded to the displayed precision.
  166.  
  167. Entries made on this form are not checked until math is performed during form
  168. execution.  Improperly defined equations will cause the math operations to
  169. terminate early and display an error message.  This is also true for fields
  170. that do not contain a valid number, and such conditions such as divide by
  171. zero, overflow, etc.
  172.  
  173.